package com.ry.rabbitmq.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.ry.rabbitmq.service.ProduceService;

@RestController
@RequestMapping("/rabbitmq")
public class RabbitmqController {

	@Autowired
    ProduceService workModuleConfig;
	
	@PostMapping("/testWork")
	public void testWork(String message) {
		workModuleConfig.sendMail("simple-queue", message);
	}

    @PostMapping("/testDirect")
    public void testDirect(String key, String message) {
        workModuleConfig.sendMail("directEx", key, message);
    }
	
}
